unit uBaseObject;

interface

uses cuVector, uDefs,

     SysUtils;

type
  tBaseObject = class( TObject )
  public
    Name          : string;
    OwnerID       : integer;
    Vector2D      : TVector2D; // Hold the x,y,z of a object position in the universe, based upon the Entity its orbitting.
    Size          : integer;   // Size of the object
    Health        : integer;   // Objects can be destroyed, but needs to lose all health in one turn.
    MaxHealth     : integer;   // This maybe for capturing only.

    constructor Create();
    destructor Destroy(); override;
    procedure reset();

    procedure linkOwner(newOwnerID:integer);
    procedure unlinkOwner();

    //Events
    procedure onDraw();
    procedure onClick(var button:byte);
    procedure onKeyPress(var key:byte);
  end;

implementation

constructor tBaseObject.Create();
begin
  inherited Create();

  Vector2D := TVector2D.Create();

  reset();
end;
destructor tBaseObject.Destroy();
begin
  FreeAndNil( Vector2D );

  inherited Destroy();
end;
procedure tBaseObject.reset();
begin
  Name      := 'Name Error!';
  OwnerID   := -1;

  Vector2D.setVector2D( 0,0 );

  Size      := 0;
  Health    := 1;
  MaxHealth := 1;
end;
procedure tBaseObject.linkOwner(newOwnerID:integer);
begin
  OwnerID := newOwnerID;
end;
procedure tBaseObject.unlinkOwner();
begin
  OwnerID := -1;
end;

procedure tBaseObject.onDraw();
begin
end;
procedure tBaseObject.onClick(var button:byte);
begin
end;
procedure tBaseObject.onKeyPress(var key:byte);
begin
end;

end.
